<?php

/**
 * FocusContent form base class.
 *
 * @method FocusContent getObject() Returns the current form's model object
 *
 * @package    iEasy
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseFocusContentForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'focus_content_id' => new sfWidgetFormInputHidden(),
      'content_id'       => new sfWidgetFormInputText(),
      'content_type_i'   => new sfWidgetFormInputText(),
      'create_time'      => new sfWidgetFormDateTime(),
      'modify_time'      => new sfWidgetFormDateTime(),
      'short_word'       => new sfWidgetFormTextarea(),
      'sub_title'        => new sfWidgetFormTextarea(),
      'focus_photo'      => new sfWidgetFormTextarea(),
      'is_on_top_b'      => new sfWidgetFormInputText(),
      'order_i'          => new sfWidgetFormInputText(),
      'catalog_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog'), 'add_empty' => true)),
      'status_id'        => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'focus_content_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('focus_content_id')), 'empty_value' => $this->getObject()->get('focus_content_id'), 'required' => false)),
      'content_id'       => new sfValidatorInteger(array('required' => false)),
      'content_type_i'   => new sfValidatorInteger(array('required' => false)),
      'create_time'      => new sfValidatorDateTime(array('required' => false)),
      'modify_time'      => new sfValidatorDateTime(array('required' => false)),
      'short_word'       => new sfValidatorString(array('required' => false)),
      'sub_title'        => new sfValidatorString(array('required' => false)),
      'focus_photo'      => new sfValidatorString(array('required' => false)),
      'is_on_top_b'      => new sfValidatorInteger(array('required' => false)),
      'order_i'          => new sfValidatorInteger(array('required' => false)),
      'catalog_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog'), 'required' => false)),
      'status_id'        => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('focus_content[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'FocusContent';
  }

}
